<?php 
$curr_controller = Yii::app()->controller->id;
$curr_action = Yii::app()->controller->action->id;
$bannerModel = Banner::model()->find('type=2 AND status=1');
?>
<!DOCTYPE html>
<html>
    <head>        
        <title><?php echo isset($this->pageTitle) ? $this->pageTitle : Yii::app()->name; ?></title>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <meta name="ROBOTS" content="index,follow">
        <meta name="AUTHOR" content="Game.vn">
        <meta http-equiv="EXPIRES" content="0">
        <meta name="RESOURCE-TYPE" content="DOCUMENT">
        <meta name="DISTRIBUTION" content="GLOBAL">
        <meta name="COPYRIGHT" content="Copyright (c) by Esimo">
        <meta name="Googlebot" content="index,follow,archive">
        <meta name="RATING" content="GENERAL">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">                
        
        <link rel="shortcut icon" href="<?php echo Yii::app()->createUrl('images/favicon.png');?>" />   
        
        <?php Yii::app()->clientScript->registerCssFile('/css/style_smartphone.css') ?>
        <?php Yii::app()->clientScript->registerCssFile('/css/idangerous.swiper.css') ?>
                
        <?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>  
        <?php Yii::app()->clientScript->registerScriptFile('/js/idangerous.swiper-2.1.min.js') ?>        
        
        <script type="text/javascript">
            baseUrl = '<?php echo Yii::app()->baseUrl; ?>';
        </script>
        <?php include_once'googleanalytic.php'; ?>           
    </head>
    <body>
        <div id="wapper">
            <div id="header">
                <div class="top-header">
                    <h1><a href="<?php echo Yii::app()->homeUrl; ?>"><img width="168px" height="40px" src="<?php echo Yii::app()->createUrl('images/logo.png') ?>"/></a></h1>
                    <a class="phone-number" href="tel:01282357106"></a>
                </div>  
                <div id="menu">
                    <table id="table_menutop" border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr>
                                <td width="159px" class=" menu_top menu_top_left <?php if($curr_controller == "site" && ($curr_action == "index" ||$curr_action == "detail")) echo "active" ?>"><a href="<?php echo Yii::app()->homeUrl; ?>">TẢI GAME</a></td>
                                <td width="161px" class=" menu_top_center <?php if($curr_controller == "post" && $curr_action  == "news") echo "active" ?>"><a href="<?php echo Yii::app()->createUrl('post/news') ?>">SỰ KIỆN</a></td>
                                <td width="158px" class=" menu_top menu_top_right <?php if($curr_controller == "post" && $curr_action == "guide") echo "active" ?>"><a href="<?php echo Yii::app()->createUrl('post/guide') ?>">HƯỚNG DẪN</a></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                
                <div class="clear-both"></div>
                <div class="bottom-header"></div>
            </div>        
            <?php echo $content;?>        
            
            <?php if(isset($bannerModel)): ?>
            <div style="position:fixed;bottom:0;right:0;z-index:1;max-height:110px;">
                <img id="close_banner" style="position:absolute;right:0" src="<?php echo Yii::app()->createUrl('css/images/close_icon.png'); ?>"/>
                <a href="<?php echo $bannerModel->link?>"><img width="100%" src="<?php echo Yii::app()->createUrl($bannerModel->file); ?>"/></a>
            </div>
            <?php endif;?>
            <div id="footer">
                <div class="copyright">@GAME 2014 - <span><a href="tel:01282357106"><b>Hotline: </b>01282357106</a></span> </div>                
            </div>
        </body>     
    </div>
</html>    
<script type="text/javascript">
$(document).ready(function(){
    $("#close_banner").click(function(){        
        $(this).parent('div').hide();
    })
})    
</script>